package com.yt.user.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.user.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.user.mapper.CarouselInfoMapper;
import com.yt.user.models.service.ICarouselInfoService;
import com.yt.user.models.bo.CarouselInfoSaveBO;
import com.yt.user.models.dto.CarouselInfoDTO;

/**
 * 轮播图控制器
 *
 * @author lvzeming
 * @Date 2025-08-14 16:44:08
 */
@DubboService
public class CarouselInfoServiceImpl extends ServiceImpl<CarouselInfoMapper, CarouselInfoDTO> implements ICarouselInfoService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(CarouselInfoSaveBO saveBO) {
        CarouselInfoDTO dto = new CarouselInfoDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
